<template>
  <div class="lawyer-platform">
    <div class="lawyer" v-for="(item, i) in listData" :key="i">
      <img :src="item.avatar_image" @click="to(item.id)" />
      <div class="info">
        <div class="flex between">
          <span class="name">{{ item.name }}</span>
          <div class="title">
            <div class="lawyer-title mr-1">{{ item.title }}</div>
          </div>
        </div>
        <div class="lawyer-detail">
          <span class="life">职业{{ item.year }}年</span>
          <span class="domain-nickName" v-for="(category, index) in item.category_data" :key="index">{{ category.title }}</span>
        </div>
        <div class="footer">
          <div class="c-6b6b6b">
          {{ item.city_name }} |
          <span @click="to('office')">
            <template v-if="lawfirmName">{{ lawfirmName }}</template>
            <template v-else> {{ item.lawyer_firm ? item.lawyer_firm.name : "" }} </template>
          </span>

          </div>

            <div v-if="item.distance" class="mr-1">{{ item.distance }}</div>
        </div>
      </div>
    </div>
    <yz-blank :datas="listData"></yz-blank>
  </div>
</template>
<script>
import mixins from "./mixin.js";
export default {
  mixins: [mixins],
  props: {
    search: String,
    httpUrl: {
      type: String,
      default: "plugin.lawyer-platform.frontend.controllers.merchant.getLawyer"
    },
    lawyers: {
      type: Array,
      default: () => []
    },
    request: {
      type: Boolean,
      default: true
    },
    lawyerId: {
      type: String,
      default: ""
    },
    lawfirmName: {
      type: String,
      default: ""
    }
  },
  methods: {
    to(id) {
      this.$router.push(this.fun.getUrl("lawyerDetail", { id }, { order_type: "lawyer" }));
    }
  }
};
</script>
<style lang="scss" scoped>
@import "./index.scss";
.footer{
  display: flex;
  justify-content: space-between;
  margin-right: 1rem;
}
</style>
